package com.qingzhuge.manager.service.impl;

import com.qingzhuge.manager.service.ISysUserService;
import com.qingzhuge.sms.service.IAccountValidateHandler;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author : zero.xiao
 * @description :
 * @date : 2019/1/8 0008 上午 11:25
 * @modified :
 * @since :
 */
@Component
public class AccountSmsCodeValidateUserHandlerImpl implements IAccountValidateHandler {

    @Resource
    private ISysUserService userService;


    @Override
    public boolean validate(String phone) {
        if (StringUtils.isNotBlank(phone)) {
            return null != userService.findByMobile(phone);
        }
        return true;
    }
}
